#!/bin/bash
rootpath=rootfolder
pwd1=1024
pwd2=ppbody

#unzip 7zip files
find $rootpath -maxdepth 5 -name "*.7z" -exec 7z x -y {} \;

#unzip tar files
find $rootpath -maxdepth 5 -name "*.tar" -exec tar zxvf {} \;

#unzip zip files
find $rootpath -maxdepth 5 -name "*.zip" -exec unzip -x -o- -qq -P $pwd1 {} \;
find $rootpath -maxdepth 5 -name "*.zip" -exec unzip -x -o- -qq -P $pwd2 {} \;

#unzip rar files
find $rootpath -maxdepth 5 -name "*.rar" -exec rar x -o- -p$pwd1 {} \;
find $rootpath -maxdepth 5 -name "*.rar" -exec rar x -o- -p$pwd2 {} \;
